Translating FORTRAN With Mac F2C

You can use Mac F2C to translate FORTRAN to C using four methods:

• Start up Mac F2C and select the Translate command in the File menu.  
    
• Drag-&-drop a bunch of FORTRAN files onto Mac F2C.

• Use a scripting language (such as AppleScript) to send Mac F2C either an open command, an f2c command, or a translate command.  For more information on the differences between these and for more general information on driving Mac F2C from a script, see the instructions in the chapter “Scripting Mac F2C.”  Sample AppleScripts for driving Mac F2C are included in the Mac F2C Extras folder.

• If you are using Mac F2C with CodeWarrior, you can also use the CodeWarrior MPW/ToolServer tools to drive integrated Mac F2C - CodeWarrior builds.  The ToolServer READ ME and MPW READ ME files provide detailed instructions for using these tools.
     
FORTRAN files must be TEXT files and must end in .f or .F (sorry, but the ending is determined by the unix f2c kernel—it rejects files handed to it with any other endings).  The output file has the same name with a .c extension if you selected C code for the output, or the same name with a .cp extension if you selected C++ code for the output.

The first five items in the Options menu let you control the various translation and code generation options.  If you check the Make these the new defaults box before clicking the OK button, your option selections will be saved in a preference file and used again the next time you start Mac F2C.

If you do not understand what an option means, check the balloon help.  The help balloons provide more detailed explanations of what each option means.  They also explain why dimmed options are not available and what you can do to make them available.

The last two item in the options menu (Compiler Interactions and Mac F2C Preferences) let you control how Mac F2C operates.  

The Compiler Interactions dialog lets you control how Mac F2C interacts with C/C++ compilers.  More specifically, it allows you to specify:

• Which C/C++ compilers Mac F2C will interact with.  Current choices are THINK C/C++, Symantec C/C++, CodeWarrior C/C++ 68K, CodeWarrior C/C++ PPC, and CodeWarrior IDE v1.3 (integrated 68K/PPC environment).

• The level of interaction with those compilers.  This varies from No Interaction all the way to Build Target(s).  If a group of FORTRAN files are translated at once (via a drag-&-drop or via an AppleScript), Compile, Update, and Build commands are not sent until the all files in the group are translated.  All interactions will fail silently if the corresponding C/C++ compiler isn’t running or for any reason cannot complete the compilers or links.
      
The last item in the Options menu (Mac F2C Preferences) lets you control how Mac F2C operates.  This dialog lets you control:

• How Mac F2C behaves after having been launched with a drag-&-drop.
    
• Whether the Advanced Options dialog will have an edit text field that allows you to enter unix option switches directly.

• Whether to silently skip non-FORTRAN files that are dropped on Mac F2C.
      
• The creator type for all of the output files (this determines their icon).
    
In all cases, check the balloon help if you do not understand what an option means.